package cn.example.backstage.order.controller;

import cn.example.backstage.base.response.JsonResult;
import cn.example.backstage.order.pojo.dto.RootDTO;
import cn.example.backstage.order.pojo.vo.RootVO;
import cn.example.backstage.order.server.RootService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "管理员管理")
@RestController
@RequestMapping("v1/root")
public class RootController {

    @Autowired
    private RootService rootService;

    @ApiOperation(value = "查询管理员信息")
    @GetMapping("select")
    public JsonResult selectRoot(RootDTO rootDTO) {
       log.debug("管理员信息:,{}",rootDTO);
       List<RootVO> list = rootService.select(rootDTO);
       log.debug("查询管理员信息:,{}",list);
       return JsonResult.ok(list);
    }

}
